﻿using Ardalis.Specification;
using HuaweiCloud.Dotnet.Samples.ESports.Main.Entities;

namespace HuaweiCloud.Dotnet.Samples.ESports.Main.Specification
{
    public class CommunityEventsSpecification : Specification<CommunityEvents>
    {
        /// <summary>
        /// 获取当前进行中的活动
        /// </summary>
        /// <param name="time"></param>
        public CommunityEventsSpecification(DateTime time)
        {
            Query.Where(x => x.StartTime <= time && time < x.EndTime);
        }
    }
}
